package com.maimao.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maimao.model.goods.SpecDetails;
import com.maimao.model.goods.SpecGroup;
import com.maimao.model.goods.SpecOptions;
import com.maimao.model.goods.input.SpecDetailForm;
import com.maimao.model.goods.vo.SpecDetailVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/11 8:22 下午
 */
public interface SpecDetailMapper extends BaseMapper<SpecDetails> {


    /**
     * 根据规格组id查询细分规格 ex
     */
    List<SpecDetailVo> selectDetailExByGroupId(@Param("groupId") Integer groupId);

    /**
     * 根据规格组查询细分规格
     */
    List<SpecDetails> selectDetailByGroupId(@Param("groupId") Integer groupId);


    /**
     * 根据规格细分id查询表单选项
     * @param detailId
     * @return
     */
    List<SpecOptions>selectOptionsByDetailId(@Param("detailId")Integer detailId);


    int updateCus(SpecDetails specDetails);

    /**
     * 根据三级分类查询规格细分
     */
    List<SpecDetailVo> selectDetailByCid(Integer categoryId);

    List<SpecDetails> selectAll();

    /**
     * 根据三级分类查询可搜索的规格
     * @param categoryId
     * @return
     */
    List<SpecDetails> selectSearchableByCid(Integer categoryId);

    List<SpecDetails> selectSearchableByCidList(@Param("cids") List<Integer> categoryIdList);
}
